1. Field of the Invention
The present invention relates to an image processing method and an image processing apparatus for correcting unevenness of lightness, deformation, a blur, or the like, which occurs in an image of a center portion of a pair of spread (open) pages of a bound book (as an original document) when the spread pages of the book are read by a flat bed scanner (as an image reading apparatus) having a document table. The flat bed scanner is contained in general-purpose scanners, filing systems, copiers, facsimile machines, and various printing machines. In this specification, a center portion of a pair of spread pages of a bound book, i.e., a portion near the binding of a book, may be referred to as a book center.
2. Description of the Related Art
FIG. 1 is a perspective view illustrating relative positions of a document table, a book document, and an image reading apparatus. When a pair of spread (open) pages of a book document is read by a flat bed scanner, the book center, i.e., a portion near the binding of the book, is lifted from the document table. Therefore, the image of the book center is darkened, deformed, and blurred. That is, the book center portion of the scanned image of the book document becomes hard to see.
In order to solve the above problem, Japanese Unexamined Patent Publication No. 62(1987)-143557 discloses a document reading apparatus which comprises a distance sensor for detecting a distance between the document table and each position of a surface of an original document, and the sub-scanning pitch is varied according to the distance between the document table and each position of the surface of the original document, so as to eliminate deformation in the sub-scanning direction and enable accurate reading of image information on the original document.
In addition, Japanese Unexamined Patent Publication No. 3(1991)-117965 discloses a document reading apparatus which comprises a document reading means arranged at a predetermined distance from an original document. The document reading apparatus detects curvature of surfaces of the original document, and corrects image data according to the detected curvature, when reproducing the image.
However, the technique of Japanese Unexamined Patent Publication No. 62(1987)-143557 has a drawback that the image reading apparatus must have the distance sensor and a mechanism for changing the sub-scanning pitch according to the distance between the document table and each position of the surface of the original document during the scanning operation. On the other hand, in the document reading apparatus of Japanese Unexamined Patent Publication No. 3(1991)-117965, the document reading means is arranged to read the original document from above, and the document reading means must be held at a predetermined distance from the original document. That is, the document reading apparatus disclosed in Japanese Unexamined Patent Publication No. 3(1991)-117965 is not a flat bed scanner. That is, the constructions of the document reading apparatuses disclosed in Japanese Unexamined Patent Publication Nos. 62(1987)-143557 and 3(1991)-117965 are different from the conventional general-purpose scanner. Therefore, the cost is considerably increased for the above special constructions.
Further, when spread (open) pages of a book document are read by a flat bed scanner, outlines of pages other than the open pages appear in the scanned image as illustrated in FIG. 2, in addition to the aforementioned darkened, deformed, and blurred image of the book center. Therefore, it is difficult to determine the edges (contour) of the open pages and the heights of the edges by the document reading apparatuses disclosed in Japanese Unexamined Patent Publications Nos. 62(1987)-143557 and 3(1991)-117965.
A first object of the present invention is to provide an image processing method and an image processing apparatus which can correct deformation, unevenness of lightness, and a blur in an image of a book center, using only low cost image processing, where the image of the book center is obtained by scanning a pair of spread (open) pages of a bound book placed on a document table.
A second object of the present invention is to provide a book-center-height obtaining unit which can obtain a plurality of heights (lifts) of a plurality of points of the book center above a document table, based on only an image of the book center, when the image of the book center is obtained by scanning a pair of spread pages of a bound book placed on a document table.
According to the first aspect of the present invention, there is-provided an image processing method which includes the steps of (a) obtaining a plurality of heights, above a document table, of a plurality of points of a pair of spread pages of a bound book as an original document, based on a contour of the pair of spread pages which appears in an image of the pair of spread pages, where the bound book is placed on the document table; and (b) correcting degradation of the image of the pair of spread pages, based on the plurality of heights obtained by the height obtaining unit.
According to the second aspect of the present invention, there is provided an image processing apparatus which contains a height obtaining unit which obtains a plurality of heights, above a document table, of a plurality of points of a pair of spread pages of a bound book as an original document, based on a contour of the pair of spread pages which appears in an image of the pair of spread pages, where the bound book is placed on the document table; and an image correcting unit which corrects degradation of the image of the pair of spread pages, based on the plurality of heights obtained by the height obtaining unit.
With the image processing apparatus according to the second aspect of the present invention, the heights of a plurality of points of the book center are obtained based on the contour of the book center in the image obtained by scanning the book center, and degradation of the image is corrected based on the heights obtained from the contour of the book center in the image. That is, the degradation of the image can be corrected based on only the image. Therefore, it is unnecessary to provide any specific sensor or additional device, or to change the construction of the conventional scanner. Thus, the degradation of the image can be corrected at low cost.
In the image processing apparatus according to the second aspect of the present invention, the above height obtaining unit may contain a reference line extracting unit which extracts at least one reference line based on a top and bottom portions of the contour of the pair of spread pages which appears in the image; a correction area determining unit which determines as a correction area an area of the image corresponding to a portion of the pair of spread pages which is lifted from the document table, based on the at least one reference line and the contour; a distance obtaining unit which obtains a distance from each pixel of a portion of the contour in at least one edge of the correction area, to the at least one reference line; an edge height obtaining unit which obtains a height of each point of a top and bottom edges of the portion of the pair of spread pages above the document table, based on the distance obtained by the distance obtaining unit; and a height distribution obtaining unit which obtains a height of each point of the portion of the pair of spread pages above the document table, based on the height of each point of the top and bottom edges of the portion of the pair of spread pages.
That is, the height of each point of the edges of the book center is obtained based on the top and bottom portions of the contour of the book center which appears in the image, and the height of each point of the book center can be obtained based on the height of each point of the edges of the book center.
In the above height obtaining unit, the at least one reference line is a straight line obtained by extending an undeformed straight portion of the contour of the pair of spread pages which appears in the image.
The height of each point of the edges of the book center can be obtained even if the spread pages in the pair are differently skewed.
When the skew angles of the spread pages in the pair are identical, it is possible to obtain the distance from each pixel of a portion of the contour in at least one edge of the correction area to only one reference line. However, when obtaining the distance based on only one reference line, it is necessary to provide a means to equalize the skew angles of the spread pages in the pair. The skew angles of the spread pages on the document table are generally different, and the skew angles are often different even between the top and bottom edges of each of the spread pages. Therefore, when the above means for equalizing the skew angles of the spread pages is not provided, it is preferable to obtain reference lines (four in total) from the top and bottom edges of the respective spread pages in the pair, to accurately obtain the heights of the respective points of the book center above the document table.
The correction area may be defined as an area encircled by the top and bottom portions of the contour of the spread pages and lines connecting top and bottom branch points of the respective spread pages, where the top and bottom branch points are points at which the corresponding reference lines branch from the top and bottom portions of the contour, respectively. In other words, the branch points are points at which the correction is commenced.
The height of each point of the edges of the book center can be obtained even if the book is placed on the document table in a slanting direction. However, when the image of the bound book is read by a line sensor, the book must be placed on the document table so that the directions of the top and bottom edges of the book are not parallel to the direction of the line sensor. Otherwise, when the image of the bound book is read by an area sensor, there is no requirement regarding the direction of the book on the document table.
In the image processing apparatus according to the second aspect of the present invention, the above image correcting unit may be a unit which corrects unevenness of lightness, deformation, or a blur of the image.
When the image correcting unit in the second aspect of the present invention corrects unevenness of lightness, the image correcting unit calculates, based on the heights of the respective points of the book center, corrected values of lightness for the respective pixels of the book center portion of the image, where the corrected values of lightness are values of lightness which the respective pixels of the book center portion of the image will have if the book center of the spread pages is in contact with the document table. Then, the image correcting unit changes the values of lightness which the respective pixels of the book center portion of the image, to the corrected values of lightness. Thus, the unevenness of lightness of the image can be corrected.
When the image correcting unit in the second aspect of the present invention corrects deformation, first, the image correcting unit obtains, by calculation based on the heights of the respective points of the book center, corrected pixel positions for the respective pixels of the book center portion of the image, where the corrected pixel positions are pixel positions at which the respective points of the book center of the spread pages will be located if the book center of the spread pages is in contact with the document table. Then, the image correcting unit moves the respective pixels of the book center portion of the image to the corrected pixel positions, and interpolated values are assigned to pixels which are vacated by the movement to the corrected pixel positions. Thus, the deformation in the book center portion can be corrected.
When the image correcting unit in the second aspect of the present invention corrects a blur in the image obtained by scanning the book, the image correcting unit corrects the blur based on the heights of the respective points of the book center, by using a blur correction filter corresponding to a height (lift) of each point of the book center, i.e., a blur correction filter which is suitable for correcting a blur caused by the height (lift) of each point of the book center.
When unevenness of lightness or a blur is corrected after deformation of the image is corrected, a value of the height for the interpolated pixel is necessary. In this case, the value of the height for the interpolated pixel can be obtained based on the heights of pixels located around the interpolated pixel. On the other hand, when deformation is corrected after unevenness of lightness and/or a blur is corrected, it is unnecessary to obtain a value of the height for the interpolated pixel.